home *** CD-ROM | disk | FTP | other *** search
/ Monster Media 1996 #15 / Monster Media Number 15 (Monster Media)(July 1996).ISO / wildcat / avu1r6.zip / VIEWCOMP.WCC < prev    next >
Text File  |  1996-05-27  |  28KB  |  605 lines

  1. 'AVU - Archive View Utility
  2. '
  3. 'Written by Peter Garner, Mildew Hall OS/2. Tel: +44-(0)1420-543542
  4. 'Email Sysop@mildewh.dircon.co.uk
  5. '
  6. 'This source code is released into the public domain.
  7. '
  8. '>>If you recompile this file, you will get an "error opening input file":
  9. '>>it won't find MILDEWH.WCC - this is my own info file, and just contains
  10. '>>info about my system. It won't affect the program operation at all. See
  11. '>>the source comments.
  12. '
  13. 'Also, remember that ALL the UNZIP parameters are case sensitive! Be warned!
  14. '
  15. 'Note: all long lines are split to be readable without scrolling
  16. '
  17. '-------------------------------------------------------------------------
  18. '$INCLUDE "colours.wcc"
  19.  
  20. declare sub DeleteWorkFiles
  21. declare sub DisplayZipList (workfil2 as string)
  22.  
  23. dim rc as integer               'general purpose result code
  24. dim ch as integer               'general purpose character store
  25. dim viewit as integer           'file (number) to view
  26. dim filecounter as integer      'number of files found in Zip..
  27. dim ZipFileCnt as integer       'each file passed thru parseline
  28. dim counter as integer          '(re)settable counter
  29. dim fileareanum as integer      'area defined in Makewild for downloading
  30. dim FileToExtrAndDl as integer  'file (number) to extract and download
  31.  
  32. dim MaxDisplayByteCount as long 'maximum number of displayable bytes
  33.  
  34. dim WCXversion as string        'the version of this WCX
  35. dim InputZipFile as string      'file name to process
  36. dim DisplayZipName as string    'file name with path stripped off
  37. dim workdir as string           'where to put zip lists etc
  38. dim workfil1 as string
  39. dim workfil2 as string
  40. dim workfil3 as string
  41. dim ZipEntry as string          'File in a ZIP
  42. dim dlprofiles as string        'SecProfiles allowed to download
  43. dim configfile as string        'configuration file name and extension
  44. dim filename as string          'name of file within Zip
  45. dim filextension as string      'extension of file within Zip
  46. dim filecolour as string        'colour of display line - dim if not text..
  47.  
  48. dim Zsizeorig as string         'original filesize reported by unzip
  49. dim Zcompmeth as string         'compression method reported by unzip
  50. dim Zsizenow  as string         'compressed size of file reported by unzip
  51. dim Zpercent  as string         'percentage compression reported by unzip
  52. dim Zfiledate as string         'filedate reported by unzip
  53. dim Zfiletime as string         'filetime reported by unzip
  54.  
  55. dim testkey as string * 6       'reserved for future use
  56. dim xnode as string * 3         'current node number as a string
  57. dim viewit_S as string * 3      'caller menu choice - ascii value
  58. dim viewittype as string * 1    '"L"etter or "N"umber - caller menu choice
  59. dim filenumber as string * 3    'number of file displayed to caller
  60. dim controlz as string * 1      'DOS EOF character x'1a'
  61. dim controlzmsg as string * 35  'holds the "display limit reached" message
  62. dim filetoview(500) as string   'number of possible files in Zip
  63.  
  64. dim limit as boolean            'is there a byte view limit ?
  65. dim DisplayLimitReached as boolean  'has it been reached ?
  66. dim dlenabled as boolean        'are downloads enabled ?
  67. dim dlok as boolean             '(all) download conditions met
  68. dim filepass as boolean         'downloads password protected ?
  69. dim ZipAsEXE as boolean         'true if ZIP stored as EXE file..
  70.  
  71. dim fRec as filerecord          'File Record definition
  72.  
  73. '─ definitions ────────────────────────────────────────────────────────────────
  74. InputZipFile = Paramstr(1)      'First get our filename and path
  75.  
  76. controlz = chr$(&h1a)           'define the DOS EOF character
  77.                                 'and the message to be displayed if the
  78.                                 'display limit has been reached..
  79.                                 '
  80. controlzmsg = chr$(7) + chr$(13) + chr$(13) + chr$(10) + magenta + \
  81.               ">File Display limit reached!"
  82.                                 '
  83. configfile = ".\viewcomp.cfg"   'name of config file in current directory
  84. limit = false                   'no display limits (yet)
  85. xnode = trim$(str$(node))       'current node number as a string
  86. WCXversion = "1.6"              'application version
  87.  
  88. if exists(configfile) then      'test for config file..
  89.    open configfile for input as #1
  90.    input #1, MaxDisplayByteCount
  91.    input #1, fileareanum
  92.    input #1, filepass
  93.    input #1, dlprofiles
  94.    dlprofiles = ucase$(dlprofiles)  'maybe WC does this already ??
  95.    close #1
  96. end if
  97.  
  98. if MaxDisplayByteCount > 0 then     'tests if display limit exists
  99.    limit = true
  100. else
  101.    limit = false
  102. end if
  103.  
  104. if fileareanum < 1 then             'if no file area number allocated
  105.    dlenabled = false                'for downloads then don't allow them
  106. else
  107.    dlenabled = true
  108. end if
  109.                                     'we'll only allow downloads if there
  110.                                     'are some security levels!
  111.  
  112. if instr( dlprofiles, ucase$(user.seclevel)) then
  113.    dlok = true
  114. else
  115. if dlprofiles = "*" then            'all users can download
  116.    dlok = true
  117. else
  118. if dlprofiles = ""  then            'no users can download
  119.    dlok = false
  120. end if
  121. end if
  122. end if
  123.  
  124. gosub TruncateTrailingSlash         'now strip off the path name that WC
  125.                                     'adds to our file-to-view: don't want
  126.                                     'callers seeing that!
  127.  
  128.                                     'this next bit is a crude way of
  129.                                     'ensuring we only process ZIP or TXT files
  130.  
  131. if right$(InputZipFile, 3) = "ZIP" then
  132.     print "Opening ";green;DisplayZipName;cyan;".. please wait a moment"
  133. else
  134. if right$(InputZipFile, 3) = "EXE" then
  135.     print "Testing ";green;DisplayZipName;cyan;" for ZIP.. please wait a moment"
  136. else
  137. if right$(InputZipFile, 3) = "TXT" then
  138.     rc = displaytextfile(InputZipFile)
  139.     end
  140. else
  141.     beep
  142.     print "Sorry - This version can only handle .ZIP, some .EXE and .TXT" \
  143.           " files at the moment"
  144.     end
  145. end if
  146. end if
  147. end if
  148.                                     'now let's find a work area..
  149. if environ("AVU") = "" then         'hmm.. no SET AVU=whatever, so
  150.    workdir  = environ("TEMP")       'let's use TEMP instead..
  151. else
  152.    workdir  = environ("AVU")        'otherwise use the AVU path
  153. end if
  154.  
  155. if right$(workdir, 1) <> "\" then   'bung a trailing slash on the end of
  156.    workdir = workdir + "\"          'our work directory..
  157. end if
  158.                                     'define some workfiles..
  159.  
  160.                                     'this holds the list of the zip contents
  161.                                     'as a plain old list of files
  162. workfil1 = workdir + "view" + xnode + ".tmp"
  163.                                     'this holds the above plus headings etc
  164. workfil2 = workdir + "view" + xnode + ".tm2"
  165.                                     'holds the content of the file(s) we wish
  166.                                     'to view
  167. workfil3 = workdir + "view" + xnode + ".tm3"
  168.  
  169. if right$(InputZipFile, 3) = "EXE" then
  170.    gosub TestExeForZip
  171.    if ZipAsExe = false then
  172.       beep
  173.       print white
  174.       print "Sorry - no ZIP archive found in this EXE file.";yellow
  175.       end
  176.    end if
  177. end if
  178.  
  179. gosub UnzipToCreateFileList         'now lets unzip our file..
  180.  
  181. open workfil1 for input  as #1      'this is where the output went
  182. open workfil2 for output as #2      'now we'll add some headings etc..
  183.                                     'but we don't want ALL the fields..
  184.  
  185. print #2, cyan;"Archive View ";yellow;WCXversion; \
  186.           white;" ";chr$(254);magenta;" File ";green;DisplayZipName
  187. print #2, yellow
  188. print #2, "File  File Size         File  Creation   Path /  "
  189. print #2, "No.   Original.....Now  Date......Time   Filename"
  190. print #2, ""
  191.  
  192. counter = 5                         'set up initial counter value
  193.                                     'if the LOF value of the file list is 0,
  194.                                     'then UNZIP couldn't create it, so it
  195.                                     'must be corrupt..
  196. if lof(1) = 0 then
  197.       beep
  198.       print
  199.       print green;DisplayZipName;white;" is corrupt and has been moved offline"
  200.       print
  201.       print cyan;Makewild.SysopName;" has been notified.."
  202.       print
  203.       activitylog ">>> WARNING FROM AVU: " + InputZipFile + " is corrupt!"
  204.       reset
  205.       gosub TakeFileOffline         'so flag it as offline
  206.       call Deleteworkfiles          'delete work files
  207.       end                           'and end the program
  208. end if
  209.                                     'now read the records in our input file:
  210.                                     'if the last character is a "/" then we
  211.                                     'don't want it, as this is the way UNZIP
  212.                                     'shows a directory within the zip, and we
  213.                                     'can't display that! Otherwise, we'll
  214.                                     'parse the line and extract the fields we
  215.                                     'want..
  216. while not eof(1)
  217.       input #1, ZipEntry
  218.       if right$(ZipEntry, 1) <> "/" then gosub ParseLine
  219. wend
  220. reset                               'Done! Now close all open files
  221.  
  222. call DisplayZipList (workfil2)      'and display our nicely formatted filelist
  223. print
  224.  
  225. do
  226.    print
  227.    print yellow;
  228.  
  229.    if filecounter > 0 then          'if we have some displayable files..
  230.       DisplayLimitReached = false   'set up the flag ready...
  231.       do
  232.                                     'ask caller for number of file to view..
  233.  
  234.             print yellow+"Enter number of file to view: "+ \
  235.             green+"1 - "+str$(filecounter)+yellow+" '"+white+"Q"+yellow+ \
  236.             "' to quit";
  237.                                     'and if they can download, tell 'em about
  238.                                     'the option..
  239.  
  240.             if dlok then print " or '"+white+"D"+yellow+"' to download: ";
  241.  
  242.                                     'we have to allow letters as well as
  243.                                     'numbers, so use an alphanumeric mask
  244.  
  245.             viewit_S = inputmask("", "XXX")    'so expect a string
  246.             '
  247.             viewit = val(viewit_S)             'also store as a number
  248.  
  249.             if viewit = 0 then                 'if we get a '0', it's a
  250.                viewittype = "L"                '(L)etter!
  251.                viewit = asc(viewit_S)          'store the ascii value
  252.                gosub TestAlpha                 'and decide what to do with it!
  253.             else
  254.                viewittype = "N"                'otherwise, it's a number
  255.                viewit  = viewit                'see!
  256.                                                'if it's not an "ENTER", and
  257.                                                'it's LE the maximum number of
  258.                                                'files listed, it must be valid
  259.                                                'so exit from the loop
  260.  
  261.                if (viewit >= 0 and viewit <= filecounter) then
  262.                   exit do
  263.                end if
  264.             end if                             'otherwise just beep, and
  265.             beep                               'make the caller do it again
  266.       loop
  267.    else                                        'otherwise, IMHO, there were no
  268.                                                'displayable files found, so
  269.       beep                                     'tell the caller!
  270.       print yellow+"There are no viewable files in this archive! Press '"+ \
  271.             cyan+"0"+yellow+"' to quit ";
  272.       viewit = inputnumber("", 0, 0)           'I'll only take a zero now!
  273.       call DeleteworkFiles                     'delete work files
  274.       end                                      'and exit program
  275.    end if
  276.    '
  277.    if viewittype = "N" then                    'ok, we got a number, so
  278.                                                'lets get the file..  we'll
  279.                                                'stick it in our 3rd work file
  280.       print "Fetching ";green;filetoview(viewit);cyan;".. please wait a moment"
  281.       shell "unzip -cqqaa " + InputZipFile + " " + filetoview(viewit) + \
  282.                " > " + workfil3
  283.                cls
  284.  
  285.       if limit then gosub LimitCheck           'if sysop has set a display
  286.                                                'limit let's see if our view-
  287.                                                '-able file is too big..
  288.       '
  289.       print cyan;"Displaying ";yellow;filetoview(viewit);white;" from "; \
  290.             green;DisplayZipName;white;"  ";
  291.  
  292.       if DisplayLimitReached then              'if we hit the limit, tell
  293.                                                'the caller before he starts
  294.                                                'viewing..
  295.          print grey;"(Up to ";MaxDisplayByteCount;" bytes)";white
  296.          print
  297.       else
  298.          print
  299.       end if
  300.  
  301.       print
  302.       rc = displaytextfile(workfil3)           'and now, display it.
  303.  
  304.       if not DisplayLimitReached then          'we've finished, so tell the
  305.          print                                 'caller...
  306.          print magenta;chr$(254);" End of file ";chr$(254)
  307.       end if
  308.  
  309.       waitenter
  310.  
  311.       call DisplayZipList (workfil2)           'and redisplay the zip file
  312.                                                'list
  313.    end if
  314.    '
  315. loop
  316.  
  317. end                                            'here for safety !
  318.  
  319. '─────────────────────────────────────────────────────────────────────────
  320. ParseLine:      'if filename is valid, extract required fields
  321.  
  322. ZipFileCnt = ZipFileCnt + 1                    'increment file count
  323.  
  324. Zsizeorig = mid(ZipEntry, 1, 7)
  325. Zsizenow  = mid(ZipEntry, 17, 7)
  326. Zfiledate = mid(ZipEntry, 31, 8)
  327. Zfiletime = mid(ZipEntry, 41, 5)
  328.  
  329. filename = mid(ZipEntry,59,(len(ZipEntry)-58)) 'get the file name
  330. filextension = ucase$(right$(filename, 4))     'and the extension
  331.  
  332. if right$(filextension, 1) <> "/" then         'ignore directory names..
  333.  
  334.  'crude bit number 2..
  335.  'here's a list of file extensions that are non-text. The problem is that
  336.  'if i have to open each file, and read a few characters to try and determine
  337.  'if the files are binary or not, then this will impose a large overhead that
  338.  'may affect the system adversely. This is why this application will not
  339.  'replace Dataview, or similar software (yet). You can add others that may
  340.  'come across - don't know if there's an upper limit to select case..
  341.  'Really, there's no reason why you -shouldn't- display these files - the
  342.  'utility won't mind, it's just that strange things may happen on the screen.
  343.  'It's up to you..
  344.  
  345. select case filextension
  346.        'ignore all these..
  347.        case ".EXE", ".COM", ".BIN", ".SYS", ".ZIP", ".PAK", ".LHA", ".ARJ", \
  348.             ".RAR", ".ARC", ".DLL", ".BMP", ".ICO", ".JPG", ".HLP", ".INI", \
  349.             ".UC2", ".HAP", ".OVL", ".OVR", ".SVP", ".VBX", ".OCX", ".FRX", \
  350.             ".WCX", ".PCX", ".GIF", ".WAV"
  351.             filecolour = grey
  352.             print #2, white;"["grey;" - ";white;"]  ";grey;
  353.  
  354.        case else
  355.             filecolour = white
  356.             filecounter = filecounter + 1
  357.             filenumber = right$(("   " + str$(filecounter)), 3)
  358.             print #2, white;"["cyan;filenumber;white;"]  ";green;
  359.             filetoview (filecounter) = filename
  360. end select
  361. end if
  362.             print #2,Zsizeorig;" ";
  363.             print #2,Zsizenow;"  ";cyan;
  364.             print #2,Zfiledate;"  ";
  365.             print #2,Zfiletime;"  ";filecolour;
  366.             print #2,filename
  367.  
  368.             if ZipFileCnt > counter then      'this bit displays a "." every
  369.                print ".";                     'five filenames parsed just so
  370.                counter = counter + 5          'the caller knows it's still
  371.             end if                            'working! Useful if your disk is
  372.                                               'slow.
  373. return
  374. '─────────────────────────────────────────────────────────────────────────
  375. sub DisplayZipList (workfil2 as string)       'simply clear the screen and
  376.    cls                                        'display the list of files in
  377.    rc = displaytextfile(workfil2)             'the archive
  378. end sub
  379.  
  380. '─────────────────────────────────────────────────────────────────────────
  381. TakeFileOffline:                              'take a (corrupt) file offline
  382.    '
  383.    if Getfileinfo(fRec, DisplayZipName) then
  384.       fRec.flags = &H020                      'means "offline"
  385.       fRec.keywords(6) = "CORRUPT!"           'change 6th keyword
  386.       Updatefile(fRec)                        'update filebase record
  387.       activitylog ">>> MESSAGE FROM AVU: moved " + InputZipFile + " offline!"
  388.    else
  389.       activitylog ">>> WARNING FROM AVU: unable to move " + InputZipFile + \
  390.                   " offline!"
  391.    end if
  392.    '
  393. return
  394. '─────────────────────────────────────────────────────────────────────────
  395. Sub DeleteWorkFiles                           'delete workfiles if they exist
  396.     if exists(workfil1) then kill workfil1
  397.     if exists(workfil2) then kill workfil2
  398.     if exists(workfil3) then kill workfil3
  399. end sub
  400.  
  401. '─────────────────────────────────────────────────────────────────────────
  402. Limitcheck:                                   'check to see if the file is
  403.                                               'too big to display all..
  404.                                               'the file is opened in binary
  405.                                               'mode. if it's too big, a DOS
  406.                                               'EOF character is written at
  407.                                               'specified limit position, then
  408.                                               'rewind the number of bytes in
  409.                                               'the warning msg, and write the
  410.                                               'msg! If you change the message,
  411.                                               'don't forget to change the msg
  412.                                               'length variable!
  413.  
  414. 'I'm really chuffed with this bit - it shows just how useful DOS can be
  415. 'be, and it saves loadsa file i/o!
  416.  
  417.     open workfil3 for binary as #1
  418.          if lof(1) > MaxDisplayByteCount then
  419.             put #1, (MaxDisplayByteCount - len(controlzmsg)), controlzmsg
  420.             put #1, MaxDisplayByteCount, controlz
  421.             DisplayLimitReached = true
  422.          end if
  423.     close #1
  424.  
  425. return
  426. '─────────────────────────────────────────────────────────────────────────
  427. TestAlpha:                                    'here's where our (L)etter
  428.                                               'options are handled..
  429.        if viewittype = "L" then
  430.           select case viewit
  431.                  case 48, 81, 113             ' 0/Q/q  - quit
  432.                       call DeleteworkFiles
  433.                       end
  434.  
  435.                  case 68, 100                 'D/d - download a file
  436.                  '
  437.                  if dlenabled then            'are we okay to go ??
  438.                  if dlok then
  439.                       FileToExtrAndDl = inputnumber("Download which file #:"+\
  440.                       green+"0, 1 - " + str$(filecounter)+yellow+" ",\
  441.                       0 , filecounter)
  442.                                               'we can abort by typing '0'
  443.                                               'so just display the ZIP list
  444.                       if FileToExtrAndDl = 0 then
  445.                          call DisplayZipList (workfil2)
  446.                          return
  447.                       end if
  448.                                               'if there's a path, we can't
  449.                                               'handle it yet, so fudge it
  450.                                               'for now. Might be okay to
  451.                                               'make up a filename on the fly..
  452.  
  453.                       if instr(filetoview(FileToExtrAndDl), "/") then
  454.                          beep
  455.                          print cyan;"Sorry! Can't (yet) extract files with pathnames.."
  456.                          print "Turn screen capture on and use view (";white;FileToExtrAndDl;cyan;")instead";white
  457.                          waitenter
  458.                       else                    'ok, extract it to our temporary
  459.                                               'file area - remember that ?
  460.  
  461.                           shell "unzip -qoj " + InputZipFile + " " + \
  462.                                  filetoview(FileToExtrAndDl) + " -d " + \
  463.                                  workdir
  464.                                               'now find the file size:good old
  465.                                               'binary mode again!)
  466.                           open workdir+filetoview(FileToExtrAndDl) for binary as #1
  467.                           frec.size = lof(1)  'update WC field
  468.                           close #1
  469.                                               'update other WC fields
  470.                           fRec.name = filetoview(FileToExtrAndDl)
  471.                           fRec.StoredPath = workdir
  472.                           fRec.area = fileareanum
  473.                           fRec.description = green + "File for " + cyan + \
  474.                                              user.name + \
  475.                                              green + " extracted from "+ \
  476.                                              magenta + \
  477.                                              DisplayZipName
  478.  
  479.                                              'if we specified password mode,
  480.                                              'then add one now - use the
  481.                                              'caller's login password!
  482.                           if filepass then fRec.password = user.password
  483.                                              'Give AVU the upload credit..
  484.                           fRec.uploader = "AVU"
  485.                           fRec.keywords(1) = "AVU"
  486.                                              'This section updates or adds the
  487.                                              'file we just extracted to the
  488.                                              'files database, ready for d/ld.
  489.                           if addfile(fRec) then
  490.                           activitylog "Extracted " + filetoview(FileToExtrAndDl) + \
  491.                                       " for download (new)"
  492.                             if Getfileinfo(fRec, filetoview(FileToExtrAndDl)) then
  493.                                Updatefile(fRec)
  494.                                beep
  495.                                print
  496.                                gosub FileReadyMsg 'Tell caller file is ready
  497.                             end if
  498.                           else
  499.                           activitylog "Extracted " + filetoview(FileToExtrAndDl) + \
  500.                                       " for download (update)"
  501.                           beep
  502.                           gosub FileReadyMsg 'Tell caller file is ready
  503.                           end if
  504.                       end if
  505.                       return
  506.                       '
  507.                  end if
  508.                  else
  509.                      beep 'no download area assigned..
  510.                      print "Sorry: ";Makewild.SysopName;" has not " \
  511.                            "configured a download area.."
  512.                      waitenter
  513.                  end if
  514.  
  515.                  'this whole section can be deleted if desired, or you can
  516.                  'put your own advertising in.
  517.                  'If you aren't compiling it at Mildew Hall, you should
  518.                  'comment out the '$INCLUDE anyway..
  519.                  '-----------------8< snip ----------------------------------
  520.                  case 33                       '! - exclamation'
  521.                     cls
  522.                     print white;
  523.                     print "AVU - A freeware archive view utility for Wildcat"
  524.                     '$INCLUDE "\wc411\wcc\common\mildewh.wcc"
  525.                     waitenter
  526.                     call DisplayZipList(workfil2)'back to displaying the list
  527.                  return
  528.                  '-----------------8< snip ----------------------------------
  529.                  case 63, 72, 104              '?, h, H
  530.                  print
  531.                  print cyan;"(";yellow;"h";cyan;")";green;"elp ";
  532.                  print cyan;"(";yellow;"q";cyan;")";magenta;"uit ";
  533.                  if dlenabled then if dlok then
  534.                     print cyan;"(";yellow;"d";cyan;")";white;"ownload ";\
  535.                           "extracted file from file area ";\
  536.                           green;fileareanum
  537.                  end if
  538.                  print
  539.                                                'for your average caller any
  540.                                                'other key is a mistake. If it's
  541.                                                'node 0, I left it in just for
  542.                                                'testing in case I wanted to
  543.                                                'add any more keys..
  544.                  case else
  545.                       if xnode = "0" then print viewit
  546.                       beep
  547.           end select
  548.        end if
  549.  
  550. return
  551. '─────────────────────────────────────────────────────────────────────────
  552. FileReadyMsg: 'tells caller their file is ready
  553. print green;fRec.name;white;" is ready to download from area ";cyan;\
  554.       fileareanum;white;
  555.                                                'if we're using passwords, tell
  556.                                                'caller the password - it's
  557.                                                'their own anyway!
  558.       if filepass then print " (Password is ";green;user.password;white;")";
  559.       '
  560.       print yellow
  561.       print
  562.       waitenter
  563. return
  564.  
  565. '─────────────────────────────────────────────────────────────────────────
  566. TruncateTrailingSlash: 'steps backwards through the path+filename until the
  567.                        'first "\" to get the filename alone.
  568. for ch = len(InputZipFile) to 1 step -1
  569.     if mid(InputZipFile, ch, 1) = "\" then
  570.        DisplayZipName = mid(InputZipFile, (ch+1), (len(InputZipFile) - ch))
  571.        exit for
  572.     end if
  573. next ch
  574.  
  575. return
  576.  
  577. '─────────────────────────────────────────────────────────────────────────
  578. UnzipToCreateFileList: 'UNZIP creates a filelist. The freeware unzip
  579.                        'parameter -qq means 'very quiet' so just the file
  580.                        'details and nothing else are displayed...
  581.   shell "unzip -vqq "  + InputZipFile + " > " + workfil1
  582. return
  583. '─────────────────────────────────────────────────────────────────────────
  584. TestExeForZip: 'see if we have a ZIP lurking in this EXE file ..
  585.  
  586. ZipAsExe = false                               'set the flag first..
  587.                                                'and check the header
  588. shell "unzip -Zh " + InputZipFile + " > " + workfil1
  589.  
  590. open workfil1 for binary as #1
  591.  
  592. if lof(1) = 0 then                             'nothing created, so it's
  593.    ZipAsExe = false                            'not a ZIP file, so delete
  594.    close #1                                    'the temporary file..
  595.    kill workfil1
  596. else
  597.    close #1                                    'got one - example below
  598.    kill workfil1
  599.    ZipAsExe = true  'Archive:  area_88/WINZIP95.EXE   497993 bytes   19 files
  600. end if
  601.  
  602. return
  603. '
  604. 'End of source code for version 1.6
  605.